package com.jrzh.mvc.convert.sys;

import com.jrzh.framework.base.convert.BaseConvertI;
import com.jrzh.common.exception.ProjectException;
import com.jrzh.mvc.model.sys.MobileSmsSendModel;
import com.jrzh.mvc.view.sys.MobileSmsSendView;
import com.jrzh.common.utils.ReflectUtils;

public class MobileSmsSendConvert implements BaseConvertI<MobileSmsSendModel, MobileSmsSendView> {

	@Override
	public MobileSmsSendModel addConvert(MobileSmsSendView view) throws ProjectException {
		MobileSmsSendModel model = new MobileSmsSendModel();
		ReflectUtils.copySameFieldToTarget(view, model);
		return model;
	}

	@Override
	public MobileSmsSendModel editConvert(MobileSmsSendView view, MobileSmsSendModel model) throws ProjectException {
		ReflectUtils.copySameFieldToTargetFilter(view, model, new String[]{"createBy", "createTime"});
		return model;
	}

	@Override
	public MobileSmsSendView convertToView(MobileSmsSendModel model) throws ProjectException {
		MobileSmsSendView view = new MobileSmsSendView();
		ReflectUtils.copySameFieldToTarget(model, view);
		return view;
	}

}
